package net.adetech.crj.service;

import net.adetech.crj.dao.AnnouncementMapper;
import net.adetech.crj.entity.Announcement;
import net.adetech.crj.utils.InnerServiceUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service("announcement.getListByType")
public class GetAnnounmentListByTypeService implements BaseService {
    @Autowired
    AnnouncementMapper announcementMapper;

    @Override
    public Map<String, Object> invoke(Map<String, Object> params) {
        String type = (String)params.get("type");
        List<Announcement> announcementList = announcementMapper.getAnnounmentListByType(type);

        return InnerServiceUtil.buildResult("announcementList",announcementList);
    }
}
